<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" charset="UTF-8">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		
		<link type="text/css" rel="stylesheet" href="../css/model/bootstrap.css" />
		<link type="text/css" rel="stylesheet" href="../css/top5.css" />
		<link type="text/css" rel="stylesheet" href="../css/register.css" />
		
		
		<script type="text/javascript" src="../js/model/jquery-2.1.4.min.js"></script>
		<script type="text/javascript" src="../js/model/bootstrap.js"></script>
		<script type="text/javascript" src="../js/layer/layer.js"></script>
		<script type="text/javascript" src="../js/model/reset_font.js"  ></script>
		<script type="text/javascript" src="../js/register.js"></script>
		
		<title>优当借书</title>
		<style>
			
		</style>
		<script>
			$(function(){
				$("body").css("opacity",1);
			})
			
		</script>
	</head>
	<body style="opacity: 0;">
		<div class="top">
			<a href="login.html" class="goback">
				<img src="../images/icons/goback2.png">
			</a>
			<span>验证手机</span>
		</div>
		<div class="main">
			<form name="registerForm" class="registerForm" method="post" action="setkey.html" onsubmit="return checkform()">
				<div class="item telphone">
					<img src="../images/register/telPic.png" class="phonePic" />
					<input type="text" class="phone" name="phone" placeholder="请输入手机号" onkeyup="checktype()" 
						ng-pattern="/[^a-zA-Z]" maxLength="15"/>
				</div>
				
				<div class="item keys keybefore">
					<img src="../images/register/keyPic1.png" class="keyPic" />
					<input type="text" class="key" name="key" placeholder="请输入验证码" onkeyup="checktype()"/>
				</div>
				<div class="sendmsg">
					<input type="button" class="sendCode" value="获取验证码" onclick="sendCode(this)" />
				</div>
			
				<input type="button" class="sub un" name="sub" value="下一步"/>
				
				
				<div class="bot">
					<div class="botLeft">点击下一步，即同意<a href="xieyi.html" class="xieyi">《优当借书网用户协议》</a></div>
					<div class="botRight">
						<a href="login.html">密码登录</a>
					</div>
					<div class="clear"></div>
				</div>
			
			</form>
			
				<script type="text/javascript">
				 var clock = '';
				 var nums = 60;
				 var btn;
				 function sendCode(thisBtn){ 
				 	var flag=check_tel("phone");console.log(flag);//验证手机号是否正确
				 	if(flag){
				 		var times=true;
				 		if(times){
				 			btn = thisBtn;
							btn.disabled = true; //将按钮置为不可点击
						 	layer.msg("验证码已发送至你的手机");
						 	btn.value = nums+'s';
						 	clock = setInterval(doLoop, 1000); //一秒执行一次
				 		}else{
				 			layer.msg("当前获取验证码的机会已用完");
				 		}
				 		 
					}else{
						//暂时没有操作
					}
				 	
					function doLoop(){
						 nums--;
						 if(nums > 0){
						  btn.value = nums+' s';
						 
					}else{
						  clearInterval(clock); //清除js定时器
						  btn.disabled = false;
						  btn.value = '重新发送';
						  nums = 60; //重置时间
						}
					}
				 }
				
				</script>
		</div>
	</body>
</html>
